/*
 * @Date: 2024-04-22 13:17:56
 * @LastEditors: lyx
 * @LastEditTime: 2024-04-24 15:49:51
 * @FilePath: \taro-template3\src\packageA\components\ChatRedesign\index.tsx
 * @Description:
 */
import React from "react";
import ChatAutoModelCalculate from "../ChatAutoModelCalculate";
import ChatDeviceModelCalculate, {
  DeviceModelDataType,
} from "../ChatDeviceModelCalculate";
import ChatParaModelCalculate, {
  ParaModelDataType,
} from "../ChatParaModelCalculate";
import ChatOptCalculate, { OptCalculateDataType } from "../ChatOptCalculate";
import useSequentialLoader from "@/utils/hooks/useSequentialLoader";
import "./index.less";
import BottleneckAnalysis from "../ChatBottleneckAnalysis";
import ChatRedesignReport from "../ChatRedesignReport";

interface BottleneckAnalysisDataType {
  optCalResult?: OptCalculateDataType;
  parameterBottleneckResult?: ParaModelDataType;
  deviceBottleneckResult?: DeviceModelDataType;
}
interface IProps {
  type: ChatFeatureType;
  data: any;
  loading: boolean;
  onRender?: (isForce?: boolean) => void;
}

const ChatRedesign: React.FC<IProps> = ({ type, data, loading, onRender }) => {
  return (
    <div className="chat-redesign">
      {type === "autoModelCalculate" && (
        <ChatAutoModelCalculate
          data={data}
          loading={loading}
          onRender={onRender}
        ></ChatAutoModelCalculate>
      )}
      {type === "bottleneckAnalysis" && (
        <BottleneckAnalysis
          data={data}
          loading={loading}
          onRender={onRender}
        ></BottleneckAnalysis>
      )}
      {type === "deviceReport" && (
        <ChatRedesignReport
          data={data}
          loading={loading}
          onRender={onRender}
        ></ChatRedesignReport>
      )}
    </div>
  );
};

export default ChatRedesign;
